Skip to content

feat(logger-json): JSON logger with a fail-closed secret scrubber - #22

Merged
omercnet merged 4 commits into
mainfrom
replay/12-log
Nov 21, 2026
Merged

omercnet merged 4 commits into
mainfrom
replay/12-log

Conversation

@omercnet

@omercnet omercnet commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What changed

The JSON logger adapter packages/adapters/logger-json: it implements the core logger port, writes one JSON object per line, and scrubs secrets fail-closed (a value it cannot judge is redacted, never printed). Tests cover the output format, the redaction rules and the size limits. 7 files, plus the workspace entry in bun.lock, the root tsconfig.json reference and a line in AGENTS.md.

Rebased onto main (the slices below it have merged); auto-merge is on.

Why

Logs must never leak a token, a cookie or a password; the scrubber is tested against those cases before any server code can log anything.

How it was verified

From the branch: bun install --frozen-lockfile, lint, typecheck, build, bun run test (1178 tests), bun run test:tools, bun run licence, gitleaks (this branch's history, as CI runs it, and the tree), actionlint, zizmor: all exit 0. The diff against its base is exactly the planned files plus the three named above.

Visuals

Not applicable: no user-visible behaviour yet; the log format is shown in the test expectations.

Not here yet

The development-role adapters and everything that uses the logger (server).

Checklist

  • Tests added or updated, or not applicable
  • No secrets or credentials committed
  • Docs updated, or not applicable

@baz-reviewer

baz-reviewer Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Add the logger-json adapter implementing the core Logger port with one-JSON-object-per-line output through pino. Scrub structured fields and free-text values fail-closed, enforce size and serialization limits, and cover formatting, redaction, resilience, and clock fallback with tests.

Topics

TopicDetails
Secret scrubbing Implement redactString and scrubFields to remove secret-named values, credentials, tokens, URLs, unsafe objects, and oversized structures before serialization, with comprehensive safety and limit tests.
Modified files (5)
  • bun.lock
  • packages/adapters/logger-json/src/scrub.ts
  • packages/adapters/logger-json/test/limits.test.ts
  • packages/adapters/logger-json/test/redaction.test.ts
  • tools/licence-report/lock-licences.json
Latest Contributors(1)
UserCommitDate
omercnetdocs(logger-json): sta...November 21, 2026
JSON logger flow Add createJsonLogger with configurable levels, destinations, clocks, child fields, timestamps, and event output while ensuring logging never throws.
Modified files (6)
  • AGENTS.md
  • packages/adapters/logger-json/package.json
  • packages/adapters/logger-json/src/index.ts
  • packages/adapters/logger-json/test/logger.test.ts
  • packages/adapters/logger-json/tsconfig.json
  • tsconfig.json
Latest Contributors(1)
UserCommitDate
omercnetfeat(logger-json): JSO...November 21, 2026


Merger  Activate to get a short verdict whether this PR is good to go or not

Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

@omercnet
omercnet force-pushed the replay/12-log branch 2 times, most recently from b4e97a3 to 1868ceb Compare November 21, 2026 12:26
Base automatically changed from replay/11-cfg2 to main November 21, 2026 12:28
@omercnet
omercnet marked this pull request as ready for review November 21, 2026 12:30
@omercnet
omercnet enabled auto-merge (squash) November 21, 2026 12:30
@shuni-bot

shuni-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

🐕 Shuni Review

No new issues found.

🤖 Model: claude-opus-5.5 · Effort: medium


Review scope: Partial incremental re-review

Reviewed new changes (2)
  • packages/adapters/logger-json/src/scrub.ts
  • packages/adapters/logger-json/test/redaction.test.ts
Previously reviewed and unchanged: 9 files.

🐕 Review complete — View session on Shuni Portal 🐾

🤖 Model: claude-opus-5.5 · Effort: medium

@omercnet
omercnet marked this pull request as draft November 21, 2026 12:34
auto-merge was automatically disabled November 21, 2026 12:34

Pull request was converted to draft

@omercnet
omercnet marked this pull request as ready for review November 21, 2026 12:34
@omercnet
omercnet enabled auto-merge (squash) November 21, 2026 12:34

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: 2 inline findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: 1 inline finding. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

@omercnet
omercnet marked this pull request as draft November 21, 2026 12:49
auto-merge was automatically disabled November 21, 2026 12:49

Pull request was converted to draft

@omercnet
omercnet marked this pull request as ready for review November 21, 2026 12:49
@omercnet
omercnet enabled auto-merge (squash) November 21, 2026 12:49

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: no new findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

@omercnet
omercnet marked this pull request as draft November 21, 2026 12:57
auto-merge was automatically disabled November 21, 2026 12:57

Pull request was converted to draft

@omercnet
omercnet marked this pull request as ready for review November 21, 2026 12:57
@omercnet
omercnet enabled auto-merge (squash) November 21, 2026 12:57

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: no new findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

@omercnet
omercnet merged commit 8f24344 into main Nov 21, 2026
12 checks passed
@omercnet
omercnet deleted the replay/12-log branch November 21, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant